/**
 * Copyright (c) 2011 eelpo.com
 * All rights reserved.
 */
package com.eelpo.cmmp.uac.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.eelpo.cmmp.core.spring.orm.jpa.BasicCommonDao;
import com.eelpo.cmmp.uac.dao.IEnterpriseRelationManageDao;
import com.eelpo.cmmp.uac.dao.entity.TEnterpriseRelation;
import com.eelpo.common.query.Expression;
import com.eelpo.common.query.JpaCriteria;
import com.eelpo.common.query.criteria.Criteria;

/**
 * <pre>
 * 
 * 企业关系管理持久层实现
 * 
 * </pre>
 * 
 * @author <a href="mailto:Brian@eelpo.com">汪洪州</a>
 * @since 1.0
 */
@Repository
public class EnterpriseRelationManageDao extends BasicCommonDao implements IEnterpriseRelationManageDao {

	/**
	 * (non-Javadoc)
	 * 
	 * @see com.eelpo.cmmp.uac.dao.IEntityRelationManageDao#getParentRelation(java
	 *      .lang.String)
	 */
	@Override
	public List<TEnterpriseRelation> getParentRelation(String enterpriseId) {
		Criteria criteria = JpaCriteria.create(TEnterpriseRelation.class);
		criteria.add(Expression.eq("childEntity.id", enterpriseId));
		return getResultList(criteria);
	}

}
